home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 6 / QRZ Ham Radio Callsign Database - Volume 6.iso / pc / files / dsp / 56100tar.z / 56100tar / 56100 / g722 / 56116ads / fte000.asm < prev    next >
Encoding:
Assembly Source File  |  1992-04-15  |  19.5 KB  |  439 lines

  1.       page 75,63,0,0
  2.  
  3. ;***************************************************************
  4. ;program name = asm file that will test the ADM56116 memory and
  5. ;portb & c continuity for the functional test.
  6. ;date last modified = 05-30-90
  7. ;revision = 00
  8. ;***************************************************************
  9.  
  10. ;***************************************************************
  11. ;define equate constants
  12. ;***************************************************************
  13.  
  14. pbddr     equ  $FFC2
  15. pcddr     equ  $FFC3
  16. pbd       equ  $FFE2
  17. pcd       equ  $FFE3
  18. bcr       equ  $FFDE
  19. scrpad    equ  $40
  20. errpad    equ  $50
  21.  
  22.           org  p:$e000
  23.  
  24.  
  25. ;***************************************************************
  26. ;pmemtst11 is an address memory test in which a 0 is placed in 
  27. ;address 0 of RAM and a 1 in 1 and so forth through (8k-this  
  28. ;.lod file = approximately 7k) of program memory and the full 8k
  29. ;of X data memory.  Since the default mode is mode2, the first 2k
  30. ;of internal RAM, both P & X, are internal.    
  31. ;***************************************************************
  32.  
  33. pmemtst11 jsr  initmem 
  34.           jsr  initbcr 
  35.           move #errpad,r1     ;load initial error pointer. 
  36.           move #errpad+$f,y0  ;load errpad maximum +1 into y0. 
  37.           move #>$11,a        ;load test number. 
  38.           move #scrpad+$1,r2  ;load scrpad pointer. 
  39.           move a1,a0          ;prepare a1 to store. 
  40.           move a0,p:(r2)      ;store test number.       
  41.           move #0,x0          ;clear x0. 
  42.           move #$400,r0       ;load pmem start pointer. 
  43.           move #$1c00,r3      ;load do loop counter. 
  44.           do r3,wrtest11 
  45.           move #>$1,a         ;load a 1 adder. 
  46.           move x0,a0          ;prepare x0 to store. 
  47.           move a0,p:(r0)+     ;store a0 to memory. 
  48.           move #>$1,a         ;load a 1 adder. 
  49.           add  x0,a           ;add a 1 to x0. 
  50.           move a1,x0          ;restore x0. 
  51. wrtest11  move #0,x0          ;clear x0. 
  52.           move #$400,r0       ;reload pmem start pointer. 
  53.           do r3,rdtest11 
  54.           move p:(r0)+,a      ;get memory value. 
  55.           cmpm x0,a           ;compare read with write. 
  56.           jsne error          ;go post error. 
  57.           move #>$1,a         ;load a 1 adder. 
  58.           add x0,a            ;add a 1 to x0. 
  59.           move a1,x0          ;restore x0. 
  60. rdtest11  move #scrpad+$0,r2  ;load error pointer. 
  61.           move #$1,x0         ;load error test. 
  62.           move p:(r2),a       ;get error flag. 
  63.           cmpm x0,a           ;did an error occur. 
  64.           jeq  badhang1       ;loop on bad address. 
  65.           jmp  pmemtst12      ;go on to test2.          
  66. badhang1  jmp  badhang1       ;bad board address. 
  67.  
  68. ;***************************************************************
  69. ;pmemtst12 is a memory test that will walk a 1 through each of 
  70. ;data bus pins as the address is simulateously incremented.
  71. ;***************************************************************
  72.  
  73. pmemtst12 move #>$12,a        ;load test number. 
  74.           move #scrpad+$1,r2  ;load srcpad pointer. 
  75.           move a1,a0          ;prepare a1 to store. 
  76.           move a0,p:(r2)      ;store test number.       
  77.           move #$400,r0       ;load pmem start pointer. 
  78.           move #$160,r3       ;load do loop counter. 
  79.           do   r3,wrtest12
  80.           move #>$1,x0        ;load initial bit. 
  81.           do   #$10,wrtest120 
  82.           move x0,a0          ;prepare x0 to store. 
  83.           move a0,p:(r0)+     ;store a0 to memory. 
  84.           move x0,b           ;move x0 to b to shift left. 
  85.           lsl b               ;shift bit left. 
  86.           move b1,x0          ;restore x0. 
  87. wrtest120 nop 
  88. wrtest12  move #$400,r0       ;load pmem start pointer. 
  89.           do   r3,rdtest12 
  90.           move #>$1,x0        ;load initial bit. 
  91.           do   #$10,rdtest120 
  92.           clr  a 
  93.           move p:(r0)+,a      ;get read word. 
  94.           cmp  x0,a 
  95.           jsne error 
  96.           move x0,b           ;move x0 to b to shift left. 
  97.           lsl b               ;shift bit left. 
  98.           move b1,x0          ;restore x0. 
  99. rdtest120 nop 
  100. rdtest12  move #scrpad+$0,r2  ;load error pointer. 
  101.           move #$1,x0         ;load error test. 
  102.           move p:(r2),a       ;get error flag. 
  103.           cmpm x0,a           ;did an error occur. 
  104.           jeq  badhang2       ;loop on bad address. 
  105.           jmp  pmemtst13      ;go on to test3.          
  106. badhang2  jmp  badhang2       ;bad board address. 
  107.  
  108. ;***************************************************************
  109. ;pmemtst13 is a memory test that will walk a 0 through each of 
  110. ;data bus pins as the address is simulateously incremented.
  111. ;***************************************************************
  112.  
  113. pmemtst13 move #>$13,a        ;load test number. 
  114.           move #scrpad+$1,r2  ;load srcpad pointer. 
  115.           move a1,a0          ;prepare a1 to store. 
  116.           move a0,p:(r2)      ;store test number.       
  117.           move #$400,r0       ;load pmem start pointer. 
  118.           move #$160,r3       ;load do loop counter. 
  119.           do   r3,wrtest13 
  120.           move #>$fffe,x0     ;load initial bit. 
  121.           do   #$10,wrtest130 
  122.           move x0,a0          ;prepare x0 to store. 
  123.           move a0,p:(r0)+     ;store a0 to memory. 
  124.           clr  b
  125.           move #$80,b2        ;prepare to set carry flag.
  126.           asl  b              ;set carry flag.
  127.           move x0,b           ;move x0 to b to shift left. 
  128.           rol b               ;shift bit left. 
  129.           move b1,x0          ;restore x0. 
  130. wrtest130 nop 
  131. wrtest13  move #$400,r0       ;load pmem start pointer. 
  132.           do   r3,rdtest13 
  133.           move #>$fffe,x0          ;load initial bit. 
  134.           do   #$10,rdtest130 
  135.           clr  a 
  136.           move p:(r0)+,a      ;get read word. 
  137.           cmp  x0,a 
  138.           jsne error 
  139.           clr  b
  140.           move #$80,b2        ;prepare to set carry flag.
  141.           asl  b              ;set carry flag.
  142.           move x0,b           ;move x0 to b to shift left. 
  143.           rol b               ;shift bit left. 
  144.           move b1,x0          ;restore x0. 
  145. rdtest130 nop 
  146. rdtest13  move #scrpad+$0,r2  ;load error pointer. 
  147.           move #$1,x0         ;load error test. 
  148.           move p:(r2),a       ;get error flag. 
  149.           cmpm x0,a           ;did an error occur. 
  150.           jeq  badhang3       ;loop on bad address. 
  151.           jmp  xmemtst21      ;go on to x data memory.       
  152. badhang3  jmp  badhang3       ;bad board address. 
  153.  
  154. ;***************************************************************
  155. ;xmemtst21 is an address memory test in which a 0 is placed in 
  156. ;address 0 of RAM and a 1 in 1 and so forth through (8k-this  
  157. ;.lod file = approximately 7k) of program memory and the full 8k
  158. ;of X data memory.  Since the default mode is mode2, the first 2k
  159. ;of internal RAM, both P & X, are internal.    
  160. ;***************************************************************
  161.  
  162. xmemtst21 jsr  initmem 
  163.           jsr  initbcr 
  164.           move #errpad,r1     ;load initial error pointer. 
  165.           move #errpad+$f,y0  ;load errpad maximum +1 into y0. 
  166.           move #>$21,a        ;load test number. 
  167.           move #scrpad+$1,r2  ;load scrpad pointer. 
  168.           move a1,a0          ;prepare a1 to store. 
  169.           move a0,p:(r2)      ;store test number.       
  170.           move #0,x0          ;clear x0. 
  171.           move #$0,r0         ;load xmem start pointer. 
  172.           move #$2000,r3      ;load do loop counter. 
  173.           do r3,wrtest21 
  174.           move #>$1,a         ;load a 1 adder. 
  175.           move x0,a0          ;prepare x0 to store. 
  176.           move a0,x:(r0)+     ;store a0 to memory. 
  177.           move #>$1,a         ;load a 1 adder. 
  178.           add  x0,a           ;add a 1 to x0. 
  179.           move a1,x0          ;restore x0. 
  180. wrtest21  move #0,x0          ;clear x0. 
  181.           move #$0,r0         ;reload xmem start pointer. 
  182.           do r3,rdtest21 
  183.           move x:(r0)+,a      ;get memory value. 
  184.           cmpm x0,a           ;compare read with write. 
  185.           jsne error          ;go post error. 
  186.           move #>$1,a         ;load a 1 adder. 
  187.           add x0,a            ;add a 1 to x0. 
  188.           move a1,x0          ;restore x0. 
  189. rdtest21  move #scrpad+$0,r2  ;load error pointer. 
  190.           move #$1,x0         ;load error test. 
  191.           move p:(r2),a       ;get error flag. 
  192.           cmpm x0,a           ;did an error occur. 
  193.           jeq  badhang4       ;loop on bad address. 
  194.           jmp  xmemtst22      ;go on to test2.          
  195. badhang4  jmp  badhang4       ;bad board address. 
  196.  
  197. ;***************************************************************
  198. ;xmemtst2 is a memory test that will walk a 1 through each of 
  199. ;data bus pins as the address is simulateously incremented.
  200. ;***************************************************************
  201.  
  202. xmemtst22 move #>$22,a        ;load test number. 
  203.           move #scrpad+$1,r2  ;load srcpad pointer. 
  204.           move a1,a0          ;prepare a1 to store. 
  205.           move a0,p:(r2)      ;store test number.       
  206.           move #$0,r0         ;load xmem start pointer. 
  207.           move #$200,r3       ;load do loop counter. 
  208.           do   r3,wrtest22
  209.           move #>$1,x0        ;load initial bit. 
  210.           do   #$10,wrtest220 
  211.           move x0,a0          ;prepare x0 to store. 
  212.           move a0,x:(r0)+     ;store a0 to memory. 
  213.           move x0,b           ;move x0 to b to shift left. 
  214.           lsl b               ;shift bit left. 
  215.           move b1,x0          ;restore x0. 
  216. wrtest220 nop 
  217. wrtest22  move #$0,r0         ;load xmem start pointer. 
  218.           do   r3,rdtest22 
  219.           move #>$1,x0        ;load initial bit. 
  220.           do   #$10,rdtest220 
  221.           clr  a 
  222.           move x:(r0)+,a      ;get read word. 
  223.           cmp  x0,a 
  224.           jsne error 
  225.           move x0,b           ;move x0 to b to shift left. 
  226.           lsl b               ;shift bit left. 
  227.           move b1,x0          ;restore x0. 
  228. rdtest220 nop 
  229. rdtest22  move #scrpad+$0,r2  ;load error pointer. 
  230.           move #$1,x0         ;load error test. 
  231.           move p:(r2),a       ;get error flag. 
  232.           cmpm x0,a           ;did an error occur. 
  233.           jeq  badhang5       ;loop on bad address. 
  234.           jmp  xmemtst23      ;go on to test3.          
  235. badhang5  jmp  badhang5       ;bad board address. 
  236.  
  237. ;***************************************************************
  238. ;xmemtst23 is a memory test that will walk a 0 through each of 
  239. ;data bus pins as the address is simulateously incremented.
  240. ;***************************************************************
  241.  
  242. xmemtst23 move #>$23,a        ;load test number. 
  243.           move #scrpad+$1,r2  ;load srcpad pointer. 
  244.           move a1,a0          ;prepare a1 to store. 
  245.           move a0,p:(r2)      ;store test number.       
  246.           move #$0,r0         ;load xmem start pointer. 
  247.           move #$200,r3       ;load do loop counter. 
  248.           do   r3,wrtest23
  249.           move #>$fffe,x0     ;load initial bit. 
  250.           do   #$10,wrtest230 
  251.           move x0,a0          ;prepare x0 to store. 
  252.           move a0,x:(r0)+     ;store a0 to memory. 
  253.           clr  b
  254.           move #$80,b2        ;prepare to set carry flag.
  255.           asl  b              ;set carry flag.
  256.           move x0,b           ;move x0 to b to shift left. 
  257.           rol b               ;shift bit left. 
  258.           move b1,x0          ;restore x0. 
  259. wrtest230 nop 
  260. wrtest23  move #$0,r0         ;load xmem start pointer. 
  261.           do   r3,rdtest23 
  262.           move #>$fffe,x0          ;load initial bit. 
  263.           do   #$10,rdtest230 
  264.           clr  a 
  265.           move x:(r0)+,a      ;get read word. 
  266.           cmp  x0,a 
  267.           jsne error 
  268.           clr  b
  269.           move #$80,b2        ;prepare to set carry flag.
  270.           asl  b              ;set carry flag.
  271.           move x0,b           ;move x0 to b to shift left. 
  272.           rol b               ;shift bit left. 
  273.           move b1,x0          ;restore x0. 
  274. rdtest230 nop 
  275. rdtest23  move #scrpad+$0,r2  ;load error pointer. 
  276.           move #$1,x0         ;load error test. 
  277.           move p:(r2),a       ;get error flag. 
  278.           cmpm x0,a           ;did an error occur. 
  279.           jeq  badhang6       ;loop on bad address. 
  280.           jmp  porttst31      ;go on to test the ports.      
  281. badhang6  jmp  badhang6       ;bad board address. 
  282.  
  283. ;****************************************************************
  284. ;this is the entry point for portb & portc test.
  285. ;****************************************************************
  286.           
  287. porttst31 jsr  initmem 
  288.           jsr  initbcr 
  289.           move #errpad,r1     ;load initial error pointer. 
  290.           move #errpad+$f,y0  ;load errpad maximum +1 into y0. 
  291.           move #>$31,a        ;load test number. 
  292.           move #scrpad+$1,r2  ;load scrpad pointer. 
  293.           move a1,a0          ;prepare a1 to store. 
  294.           move a0,p:(r2)      ;store test number.       
  295.           move #$55aa,r0      ;load dummy port address for error.
  296.           move #$ffff,x0      ;set all of x0.
  297.           move x0,x:pbd       ;store all ones in pbd.
  298.           move x0,x:pcd       ;store all ones in pcd.
  299.           move #$0fff,x0      ;load direction for pbd.
  300.           move x0,x:pbddr     ;store direction in pbddr.
  301.           move #>$1,x0        ;load initial one in lsb.
  302.           do   #$c,endloop31
  303.           move x0,x:pbd       ;store x0 in pbd.
  304.           move x:pcd,a        ;get read data from pcd.
  305.           cmpm x0,a           ;compare read with write.
  306.           jsne error          ;go post the error.
  307.           move x0,b           ;get x0 to shift left.
  308.           lsl b               ;shift 1 bit to left.
  309.           move b1,x0          ;restore x0.
  310. endloop31 move #>$32,a        ;load test number. 
  311.           move #scrpad+$1,r2  ;load scrpad pointer. 
  312.           move a1,a0          ;prepare a1 to store. 
  313.           move a0,p:(r2)      ;store test number.       
  314.           move #$55aa,r0      ;load dummy port address for error.
  315.           move #$1,x0         ;load initial read value.
  316.           move #$7000,y1      ;load mask for bits 12,13,14.
  317.           do   #$3,endloop32  
  318.           move x0,x:pbd       ;store x0 in pbd.
  319.           move x:pbd,a        ;get read data from pbd.
  320.           and  y1,a           ;mask off desired bits via y1.
  321.           rep  #$c
  322.           lsr  a              ;move bit 12 places to right
  323.           cmpm x0,a           ;compare read with write.
  324.           jsne error          ;go post error.
  325.           move x0,b           ;get x0 to shift left.
  326.           lsl  b              ;shift bit left.
  327.           move b1,x0          ;restore x0.
  328. endloop32 move #scrpad+$0,r2  ;load error pointer.
  329.           move #$1,x0         ;load error test.
  330.           move p:(r2),a       ;get error flag.
  331.           cmpm x0,a           ;did an error occur.
  332.           jeq  badhang7       ;loop on bad address.
  333.           jmp  porttst33      ;good board address.          
  334. badhang7  jmp  badhang7       ;bad board address.
  335.  
  336. porttst33 move #>$33,a        ;load test number. 
  337.           move #>$fff,y1      ;load new mask.
  338.           move #scrpad+$1,r2  ;load scrpad pointer. 
  339.           move a1,a0          ;prepare a1 to store. 
  340.           move a0,p:(r2)      ;store test number.       
  341.           move #$55aa,r0      ;load dummy port address for error.
  342.           move #$ffff,x0      ;set all of x0.
  343.           move x0,x:pbd       ;store all ones in pbd.
  344.           move x0,x:pcd       ;store all ones in pcd.
  345.           move #$0fff,x0      ;load direction for pbd.
  346.           move x0,x:pbddr     ;store direction in pbddr.
  347.           move #>$ffe,x0      ;load initial one in lsb.
  348.           do   #$c,endloop33
  349.           move x0,x:pbd       ;store x0 in pbd.
  350.           move x:pcd,a        ;get read data from pcd.
  351.           cmpm x0,a           ;compare read with write.
  352.           jsne error          ;go post the error.
  353.           clr  b
  354.           move #$80,b2        ;prepare to set carry flag.
  355.           asl  b              ;set carry flag.
  356.           move x0,b           ;move x0 to b to shift left. 
  357.           rol  b              ;shift bit left. 
  358.           and  y1,b           ;mask b.
  359.           move b1,x0          ;restore x0. 
  360. endloop33 move #>$34,a        ;load test number. 
  361.           move #scrpad+$1,r2  ;load scrpad pointer. 
  362.           move a1,a0          ;prepare a1 to store. 
  363.           move a0,p:(r2)      ;store test number.       
  364.           move #$55aa,r0      ;load dummy port address for error.
  365.           move #>$6,x0        ;load initial read value.
  366.           do   #$3,endloop34  
  367.           move #$7000,y1      ;load mask for bits 12,13,14.
  368.           move x0,x:pbd       ;store x0 in pbd.
  369.           move x:pbd,a        ;get read data from pbd.
  370.           and  y1,a           ;mask unwanted bits.
  371.           rep  #$c
  372.           lsr  a              ;move bit 12 places to right
  373.           cmpm x0,a           ;compare read with write.
  374.           jsne error          ;go post error.
  375.           clr  b
  376.           move #$80,b2        ;prepare to set carry flag.
  377.           asl  b              ;set carry flag.
  378.           move x0,b           ;move x0 to b to shift left. 
  379.           rol  b              ;shift bit left. 
  380.           move #>$7,y1        ;load new mask.
  381.           and  y1,b           ;mask off unwanted bits.
  382.           move b1,x0          ;restore x0.
  383. endloop34 move #$ffff,x0      ;load default data for ports.
  384.           move x0,x:pbd       ;store default data in pbd.
  385.           move x0,x:pcd       ;store default data in pcd.
  386.           move #0,x0          ;load default direction.
  387.           move x0,x:pbd       ;store default dir. in pbd.
  388.           move x0,x:pcd       ;store default dir. in pcd.
  389.           move #scrpad+$0,r2  ;load error pointer.
  390.           move #$1,x0         ;load error test.
  391.           move p:(r2),a       ;get error flag.
  392.           cmpm x0,a           ;did an error occur.
  393.           jeq  badhang8       ;loop on bad address.
  394. goodhang  jmp  goodhang       ;good board address.          
  395. badhang8  jmp  badhang8       ;bad board address.
  396.  
  397. error     move #scrpad+$2,r2  ;load scratchpad pointer.
  398.           move a1,a0          ;prepare a1 to store.
  399.           move a0,p:(r2)      ;save a1.
  400.           move #scrpad+$0,r2  ;load scratchpad pointer.
  401.           move #>$1,a0        ;load error flag.
  402.           move a0,p:(r2)      ;set error flag.
  403.           move r1,a           ;prepare r1 to compare.
  404.           cmpm y0,a           ;compare r1 with errpad maximum.
  405.           jeq over0           ;jump over if no available space.
  406.           move #scrpad+$2,r2  ;load scratchpad pointer.
  407.           move (r0)-          ;decrement r0 to real error.
  408.           move r0,a0          ;prepare r0 to store.
  409.           lea (r0)+,r0        ;return r0 to original value.
  410.           move a0,p:(r1)+     ;store error address.
  411.           move x0,p:(r1)+     ;store written value.
  412.           move p:(r2),a       ;restore a1.
  413.           move a1,a0          ;prepare a1 to store.
  414.           move a0,p:(r1)+     ;store read value.
  415. over0     rts
  416.  
  417. ;***************************************************************
  418. ;this is the entry point for setting the bcr.
  419. ;***************************************************************
  420.  
  421. initbcr   move #$2,x0         ;load wait state value.
  422.           move x0,x:bcr       ;move to 0 wait states for x data 
  423.                               ;memory and 2 wait states for
  424.                               ;external program memory  using 45
  425.                               ;or 55 ns eproms at 40 Mhz
  426.                               ;operation from internal pram.
  427.           rts
  428.  
  429. ;***************************************************************
  430. ;this is the entry point to initialize the scratch pad and error
  431. ;pad memory area for the functional tests.
  432. ;***************************************************************
  433.  
  434. initmem   move #$0,x0         ;clear x0
  435.           move #scrpad,r2     ;load scrpad pointer.
  436.           do #$20,endinit
  437.           move x0,p:(r2)+     ;clear memory.
  438. endinit   rts
  439.